package com.fang.db.dynamicdatasource03shardingjdbc.service;

import com.fang.db.dynamicdatasource03shardingjdbc.entity.OrderDO;
import com.fang.db.dynamicdatasource03shardingjdbc.mapper.OrderMapper;
import com.fang.db.dynamicdatasource03shardingjdbc.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Description
 * @Author Bernie_fang
 * @Date 2022/12/18 22:52
 **/
@Service
public class OrderService {

    @Autowired
    private OrderMapper orderMapper;
    @Autowired
    private UserMapper userMapper;


    public void selectTwoTable() {
        System.out.println(orderMapper.selectById(2));
        System.out.println(userMapper.selectById(1));
    }

    public OrderDO findById(Integer id) {
        return orderMapper.selectById(id);
    }

}